//
//  UIImage+MCTools.m
//  MCPublicModule
//
//  Created by lutianlei on 2016/12/1.
//  Copyright © 2016年 Mirko. All rights reserved.
//

#import "UIImage+MCTool.h"
#import "MCCameraCompressHandle.h"
#import "MCCameraImageClipHandle.h"
#import "MCCameraImageRotationHandle.h"

@implementation UIImage (MCTool)

/**
 * pargma 按照尺寸压缩图片
 */
+ (UIImage *)imageCompressWith:(CGSize)size image:(UIImage *)image{
    
    return [MCCameraCompressHandle imageCompressWith:size image:image];
}
/**
 * pargma 将图片转换成 JEPG 格式的二进制形式
 * pargma quality 图片质量 （原图为 1 ）
 */
+ (NSData *)imageDataWithJEPG:(UIImage *)image quality:(CGFloat)value{
    return [MCCameraCompressHandle imageDataWithJEPG:image quality:value];
}
/**
 * pargma 将图片转换成 JEPG 格式的二进制形式
 * pargma quality 图片质量 1
 */
+ (NSData *)imageDataWithPNG:(UIImage *)image{
    return [MCCameraCompressHandle imageDataWithPNG:image];
}

+ (UIImage *)processImagesWithType:(EMCImageRotationType)type image:(UIImage *)image{
    return [MCCameraImageRotationHandle processImagesWithType:type image:image];
}

@end
